home *** CD-ROM | disk | FTP | other *** search
- Path: engnews1.Eng.Sun.COM!taumet!clamage
- From: boukanov@hadron.fi.uib.no (Igor Boukanov)
- Newsgroups: comp.std.c++
- Subject: Why "typedef int (*pf)() throw(int)" ill-formed?
- Date: 26 Mar 1996 18:56:11 GMT
- Organization: Fysisk institutt, Universitetet i Bergen
- Approved: clamage@eng.sun.com (comp.std.c++)
- Message-ID: <4j9808$pg1@ugress.uib.no>
- NNTP-Posting-Host: taumet.eng.sun.com
- Keywords: C++, excaptions
- X-Nntp-Posting-Host: hadron.fi.uib.no
- X-Newsreader: TIN [version 1.2 PL2]
- Content-Length: 516
- X-Lines: 26
- Originator: clamage@taumet
-
- From September DWP, 15.4.1:
- ...
- An exception-specification shall not appear in a typedef declaration.
- [Example:
- ...
- typedef int (*pf)() throw(int); // ill-formed
- --end example]
-
-
- So instead of
- typedef int (*pa)(int) throw();
- typedef int (*pf)(pa) throw();
- pf array[10];
-
- one have to write:
- int (*array[10])(int (*)(int) throw()) throw();
-
- or
- #define pa(name) int (*(name))(int) throw()
- #define pb(name) int (*(name))(pa(arg)) throw()
- pb(array[10]);
-
- ?
-
- --
- Regards, Igor Boukanov (igor.boukanov@fi.uib.no).
-
-
- [ comp.std.c++ is moderated. To submit articles: try just posting with ]
- [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
- [ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
- [ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
- [ Comments? mailto:std-c++-request@ncar.ucar.edu ]
-